#include "focus_manager.h"

lv_obj_t * focus_manager_create_hidden_focus(lv_obj_t * parent, lv_group_t * group, lv_event_cb_t key_handler)
{
    lv_obj_t * focus_obj = lv_obj_create(parent);
    lv_obj_add_flag(focus_obj, LV_OBJ_FLAG_HIDDEN);
    lv_obj_add_event_cb(focus_obj, key_handler, LV_EVENT_KEY, NULL);

    lv_group_add_obj(group, focus_obj);
    lv_group_focus_obj(focus_obj);  // 设置为当前焦点对象

    return focus_obj;
}
